package com.lcf.framework.config.enums;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lcf
 */
@Configuration
public class EnumWebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addFormatters(FormatterRegistry registry) {
        // 注册通用枚举转换器，一次注册，所有枚举通用
        registry.addConverterFactory(new EnumConverterFactory());
    }
}
